#ifndef UUID_301BAD699D8046FC06E5D5A9BFB45EA1
#define UUID_301BAD699D8046FC06E5D5A9BFB45EA1

#include "gfx.h"
#include "tl/cstdint.h"
#include "tl/vector.h"
#include "buttons.h"

typedef struct gfx_common_window gfx_common_window;

GFX_API gfx_common_window* gfx_window_create();
GFX_API void gfx_window_destroy(gfx_common_window* self);

GFX_API int  gfx_window_set_mode(gfx_common_window* self, uint32 width, uint32 height, int fullscreen);
GFX_API int  gfx_window_set_visible(gfx_common_window* self, int state);
GFX_API int  gfx_window_update(gfx_common_window* self);
GFX_API void gfx_window_end_drawing(gfx_common_window* self);
GFX_API int  gfx_window_clear(gfx_common_window* self);

enum
{
	ev_button = 0
};

typedef struct gfx_event
{
	char ev;
	char down;
	union gfx_event_u
	{
		struct { int id; } button;
	} d;
} gfx_event;

#define GFX_COMMON_WINDOW_BASE() \
	int fsaa; \
	unsigned int width; \
	unsigned int height; \
	char fullscreen; \
	int mouseX, mouseY; \
	char buttonState[numButtons + 1]; \
	tl_vector events;

typedef struct gfx_common_window
{
	GFX_COMMON_WINDOW_BASE()

} gfx_common_window;

#endif // UUID_301BAD699D8046FC06E5D5A9BFB45EA1
